<div>
	{{#unless error}}
		{{#if modalContext.isPreparing}}
			{{#modal-header}}
				{{t "modal.streaming.header.preparing"}}
			{{/modal-header}}
			{{#modal-body class="loading"}}
				{{loading-spinner}}
			{{/modal-body}}
			{{#modal-footer}}
				{{#form-button
					action=(action "abort")
					classNames="btn-danger"
					icon="fa-times"
				}}
					{{t "modal.streaming.action.abort"}}
				{{/form-button}}
			{{/modal-footer}}
		{{else if modalContext.hasEnded}}
			{{#modal-header}}
				{{t "modal.streaming.header.ended"}}{{#link-to "channel" modalContext.channel.id}}{{modalContext.channel.detailedName}}{{/link-to}}
			{{/modal-header}}
			{{#modal-body}}
				{{t "modal.streaming.body.ended"}}
			{{/modal-body}}
		{{else}}
			{{#if modalContext.isLaunching}}
				{{#modal-header}}
					{{t "modal.streaming.header.launching"}}{{#link-to "channel" modalContext.channel.id}}{{modalContext.channel.detailedName}}{{/link-to}}
				{{/modal-header}}
				{{#modal-body class="launching"}}
					{{t "modal.streaming.body.launching" provider=providerName}}
				{{/modal-body}}
				{{modal-log class="launching" log=modalContext.log}}
			{{else if modalContext.isWatching}}
				{{#modal-header}}
					{{t "modal.streaming.header.watching"}}{{#link-to "channel" modalContext.channel.id}}{{modalContext.channel.detailedName}}{{/link-to}}
				{{/modal-header}}
				{{#modal-body}}
					{{#if modalContext.stream.game}}
						<div class="game">
							<i class="fa fa-gamepad"></i> {{#link-to "games.game" modalContext.stream.game}}{{modalContext.stream.game}}{{/link-to}}
						</div>
					{{/if}}
					{{stats-row stream=modalContext.stream withFlag=false}}
					{{#unless modalContext.showLog}}
						{{embedded-links tagName="section" class="content" text=modalContext.channel.status}}
					{{else}}
						{{modal-log log=modalContext.log}}
					{{/unless}}
				{{/modal-body}}
			{{/if}}
			{{#modal-footer}}
				<div class="button-list-horizontal-wide">
					{{form-button
						action=(action "close")
						classNames="btn-primary"
						icon="fa-arrow-left"
						title=(hotkey-title
							context=this
							action="close"
							title=(t "modal.streaming.action.continue")
						)
					}}
					{{form-button
						action=(action "shutdown")
						classNames="btn-danger"
						icon="fa-times"
						title=(hotkey-title
							context=this
							action="shutdown"
							title=(t "modal.streaming.action.shutdown")
						)
					}}
					{{form-button
						action=(action "toggleLog")
						classNameBindings=":btn-log modalContext.warning:btn-danger:btn-info modalContext.isWatching::invisible"
						icon=(if modalContext.warning "fa-exclamation" "fa-ellipsis-v")
						title=(hotkey-title
							context=this
							action="log"
							title=(t "modal.streaming.action.log" provider=providerName)
						)
					}}
				</div>
				<div class="button-list-horizontal-wide">
					{{open-chat channel=modalContext.channel}}
					{{twitch-emotes channel=modalContext.channel}}
					{{share-channel channel=modalContext.channel}}
					{{channel-button channel=modalContext.channel}}
				</div>
				{{#drop-down
					value=modalContext.quality
					content=qualities
					class="stream-quality-dropdown"
					as |dropdown|
				}}
					{{#dropdown.selection as |selection|}}
						{{t (concat "qualities." selection.value)}}
					{{/dropdown.selection}}
					{{#dropdown.list as |item|}}
						{{t (concat "qualities." item.value)}}
					{{/dropdown.list}}
				{{/drop-down}}
			{{/modal-footer}}
		{{/if}}
	{{else}}
		{{#if isLogError}}
			{{#modal-header}}
				{{t "modal.streaming.header.error.log"}}
			{{/modal-header}}
			{{#modal-body class="error"}}
				{{error.message}}
			{{/modal-body}}
		{{else if isProviderError}}
			{{#modal-header}}
				{{t "modal.streaming.header.error.provider" provider=providerName}}
			{{/modal-header}}
			{{#modal-body class="error"}}
				{{#if error.message}}
					{{error.message}}
					{{#if error.error.message}}
						<br>{{error.error.message}}
					{{/if}}
					<br><br>
				{{/if}}
				{{t "modal.streaming.body.error.provider" provider=providerName}}
			{{/modal-body}}
		{{else if isPlayerError}}
			{{#modal-header}}
				{{t "modal.streaming.header.error.player"}}
			{{/modal-header}}
			{{#modal-body class="error"}}
				{{t "modal.streaming.body.error.player"}}
			{{/modal-body}}
		{{else if isVersionError}}
			{{#modal-header}}
				{{t "modal.streaming.header.error.version" provider=providerName}}
			{{/modal-header}}
			{{#modal-body class="error"}}
				{{t "modal.streaming.body.error.version" version=error.message required=versionMin}}
			{{/modal-body}}
		{{else if isUnableToOpenError}}
			{{#modal-header}}
				{{t "modal.streaming.header.error.unable-to-open"}}
			{{/modal-header}}
			{{#modal-body class="error"}}
				{{t "modal.streaming.body.error.unable-to-open" provider=providerName}}
			{{/modal-body}}
		{{else if isNoStreamsFoundError}}
			{{#modal-header}}
				{{t "modal.streaming.header.error.no-streams-found"}}
			{{/modal-header}}
			{{#modal-body class="error"}}
				{{t "modal.streaming.body.error.no-streams-found" provider=providerName}}
			{{/modal-body}}
		{{else if isTimeoutError}}
			{{#modal-header}}
				{{t "modal.streaming.header.error.timeout"}}
			{{/modal-header}}
			{{#modal-body class="error"}}
				{{t "modal.streaming.body.error.timeout" name=modalContext.channel.detailedName}}
			{{/modal-body}}
		{{else if isHostingError}}
			{{#modal-header}}
				{{t "modal.streaming.header.error.hosting" name=modalContext.channel.detailedName}}
			{{/modal-header}}
			{{#modal-body class="error"}}
				{{t "modal.streaming.body.error.hosting" name=error.channel}}
			{{/modal-body}}
		{{else}}
			{{#modal-header}}
				{{t "modal.streaming.header.error.internal"}}
			{{/modal-header}}
			{{#modal-body class="error"}}
				{{#if error.message}}
					{{error.message}}
				{{else}}
					{{t "modal.streaming.body.error.internal"}}
				{{/if}}
			{{/modal-body}}
		{{/if}}
		{{#if modalContext.log.length}}
			{{modal-log class="error" log=modalContext.log}}
		{{/if}}
	{{/unless}}
	{{#if modalContext.hasEnded}}
		{{#modal-footer}}
			<div class="button-list-horizontal-wide">
				{{#form-button
					action=(action "shutdown")
					classNames="btn-danger"
					icon="fa-times"
					title=(hotkey-title
						context=this
						action="close"
						title=(t "modal.dialog.action.close")
					)
				}}
					{{t "modal.dialog.action.close"}}
				{{/form-button}}
				{{#if (bool-or isNotFoundError isVersionError)}}
					{{#form-button
						action=(action "download")
						classNames="btn-success"
						icon="fa-download"
						iconanim=true
					}}
						{{t "modal.streaming.action.download"}}
					{{/form-button}}
				{{else if isHostingError}}
					{{#form-button
						action=(action "startHosted")
						classNames="btn-success"
						icon="fa-step-forward"
						iconanim=true
						title=(hotkey-title
							context=this
							action="confirm"
							title=(t "modal.streaming.action.start-hosted")
						)
					}}
						{{t "modal.streaming.action.start-hosted"}}
					{{/form-button}}
				{{else if modalContext.hasEnded}}
					{{#form-button
						action=(action "restart")
						classNames="btn-success"
						icon="fa-play"
						iconanim=true
						title=(hotkey-title
							context=this
							action="confirm"
							title=(t "modal.streaming.action.restart")
						)
					}}
						{{t "modal.streaming.action.restart"}}
					{{/form-button}}
				{{/if}}
			</div>
		{{/modal-footer}}
	{{/if}}
</div>